// LSL script generated: RLV-New.Updater.Update_Intern.lslp Sun May  2 00:09:51 Westeuropäische Sommerzeit 2010

integer attachment = 1;
list gMenu = [];
key ToucherID;
integer channel_dialog;
integer listen_id;
integer listen_id2;
string msg = "Update to 0.11 Beta";
list sideMenu = [" ","Back"," "];


makeMenu(){
    (gMenu = []);
    (gMenu += sideMenu);
    (gMenu += "Start");
    (channel_dialog = (-1 * ((integer)("0x" + llGetSubString(((string)llGetKey()),-5,-1)))));
    llDialog(ToucherID,msg,gMenu,channel_dialog);
    (listen_id = llListen(channel_dialog,"",NULL_KEY,""));
}

default {

    state_entry() {
    }

    
    listen(integer channel,string name,key id,string message) {
        if ((channel == channel_dialog)) {
            llListenRemove(listen_id);
            if ((message == "Start")) {
                llSetRemoteScriptAccessPin(15385);
                llSay(1336,llKey2Name(llGetOwner()));
                (listen_id2 = llListen(1336,"",llGetOwner(),""));
            }
            if ((message == "Back")) llMessageLinked(-4,1337,"DV_BASIC",ToucherID);
        }
        if ((channel == 1336)) {
            if ((message == llKey2Name(llGetOwner()))) {
                llOwnerSay("Update Done");
                llResetScript();
            }
        }
    }

    
    on_rez(integer on) {
    }

    
    link_message(integer sender,integer num,string str,key id) {
        if ((num == 1337)) {
            if ((str == llGetScriptName())) {
                (ToucherID = id);
                makeMenu();
                llMessageLinked(-4,1338,llGetScriptName(),NULL_KEY);
            }
        }
        if ((num == 1338)) {
            if ((str == "attachment")) (attachment = 1);
            else  if ((str == "device")) (attachment = 0);
            else  if ((str != llGetScriptName())) {
                llListenRemove(listen_id);
            }
        }
    }

  	timer() {
    }
}
